#include <iostream>
using namespace std;

int my_ceil(double x){
    return (int)x + (x > (int)x);
}

int main() {
    double weight; std::cin >> weight;
    if(weight < 0) return -1;
    char fexpress = 0; std::cin >> fexpress;
    if(fexpress != 'y'&&fexpress != 'n') return -2;
    int total = (fexpress == 'y') ? 5:0;
    total += weight > 1 ? my_ceil(weight - 1) + 20: 20;
    std::cout << total;
    return 0;
}
// 64 位输出请用 printf("%lld")